Skip to content

Bound tools reads' wait on stale catalog rebuilds - #1824

Merged
RhysSullivan merged 2 commits into
mainfrom
fix/tools-read-stale-sync-grace
Aug 28, 2026
Merged

Bound tools reads' wait on stale catalog rebuilds#1824
RhysSullivan merged 2 commits into
mainfrom
fix/tools-read-stale-sync-grace

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

A tools read (/api/tools, tools.search, tools.describe) rebuilds every stale connection catalog before answering. The read waited for all rebuilds, so one slow or unreachable MCP server gated every catalog read behind its network timeout — listings took tens of seconds while healthy connections sat ready.

A read now waits at most a grace budget (toolsSyncGraceMs, default 2s), then answers from the persisted catalog. Rebuilds keep running detached and land on a later read. On Workers, the new HostConfig.waitUntil seam (fed by the ambient waitUntil from cloudflare:workers) keeps those rebuilds alive past the response, so the catalog still converges.

toolsSyncGraceMs: null restores the strict blocking behavior; the stale-refresh concurrency test uses it, since its assertions synchronize on the read completing after every rebuild.

Verified: sdk + api + plugin-mcp unit suites, and the api-tools / mcp-catalog-sync e2e scenarios on both the selfhost and cloud projects. New e2e-style test covers the grace path: a parked upstream listing no longer blocks the read, and the catalog converges once the server answers.

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 73591ca Commit Preview URL

Branch Preview URL
Aug 28 2026, 09:29 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 73591ca Aug 28 2026, 09:30 AM

@pkg-pr-new

pkg-pr-new Bot commented Aug 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@1824

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@1824

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@1824

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@1824

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@1824

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@1824

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@1824

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@1824

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@1824

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@1824

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@1824

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@1824

executor

npm i https://pkg.pr.new/executor@1824

commit: 73591ca

@RhysSullivan
RhysSullivan marked this pull request as ready for review August 28, 2026 18:03
@RhysSullivan
RhysSullivan merged commit 97ff388 into main Aug 28, 2026
44 checks passed
@RhysSullivan
RhysSullivan deleted the fix/tools-read-stale-sync-grace branch August 28, 2026 18:03
@RhysSullivan RhysSullivan mentioned this pull request Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant